import React from 'react'
import { NavBar, Space, Toast } from 'antd-mobile'
import { MoreOutline } from 'antd-mobile-icons'
import { useNavigate } from 'react-router-dom'
type Props = {
    children: string
}

export default function NavBarCom(props: Props) {
    const right = (
        <div style={{ fontSize: 24 }}>
            <Space style={{ '--gap': '16px' }}>
                <MoreOutline />
            </Space>
        </div>
    )

    const navigate = useNavigate()
    const back = () => {
        // 返回上一页
        navigate(-1)
    }

    return (
        <NavBar right={right} onBack={back}>
            {props.children}
        </NavBar>
    )
}